package br.com.equus.entidade;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.envers.Audited;

import br.com.arquitetura.entidade.Entidade;

@Entity
@Table(name = "EQ_AVALIACAO_ANIMAL", catalog = "EQUUS")
@Audited
public class AvaliacaoAnimal extends Entidade<Integer> {

	private static final long serialVersionUID = 7121475300222910911L;

	@Id
	@Column(name = "ID_AVALIA_ANIMAL", unique = true, nullable = false)
	@GeneratedValue(strategy = IDENTITY)
	private Integer id;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_ANIMAL", referencedColumnName = "ID_ANIMAL")
	private Animal animal;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_TP_AVALIA_CASCO", referencedColumnName = "ID_TP_AVALIACAO", nullable = false)
	private TipoAvalicao avaliacaoCasco;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_USUARIO_RESP", referencedColumnName = "ID_USUARIO", nullable = false)
	private Usuario usuario;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_TP_AVALIA_DENTICAO", referencedColumnName = "ID_TP_AVALIACAO", nullable = false)
	private TipoAvalicao avaliacaoDenticao;

	@Column(name = "NUM_PESO", nullable = false)
	private Double peso;

	@Column(name = "NUM_CINCURFERENCIA", nullable = false)
	private Double cincurferencia;

	@Column(name = "DSC_NUTRICIONAL", columnDefinition = "text")
	private String nutricional;

	@Column(name = "DSC_SITUACAO_CASCO", columnDefinition = "text")
	private String situacaoCasco;

	@Column(name = "DSC_DENTICAO", columnDefinition = "text")
	private String denticao;

	@Column(name = "DSC_OBSERVACAO", columnDefinition = "text")
	private String observacao;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DT_CADASTRO", nullable = false)
	private Date dtCadastro;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DT_AVALIACAO", nullable = false)
	private Date dtAvaliacao;

	@Transient
	private String pesoToString;

	@Transient
	private String cincurferenciaToString;

	public AvaliacaoAnimal() {
	}

	public AvaliacaoAnimal(Integer id) {
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Animal getAnimal() {
		return animal;
	}

	public void setAnimal(Animal animal) {
		this.animal = animal;
	}

	public Double getPeso() {
		return peso;
	}

	public void setPeso(Double peso) {
		this.peso = peso;
	}

	public String getNutricional() {
		return nutricional;
	}

	public void setNutricional(String nutricional) {
		this.nutricional = nutricional;
	}

	public String getSituacaoCasco() {
		return situacaoCasco;
	}

	public void setSituacaoCasco(String situacaoCasco) {
		this.situacaoCasco = situacaoCasco;
	}

	public String getDenticao() {
		return denticao;
	}

	public void setDenticao(String denticao) {
		this.denticao = denticao;
	}

	public String getObservacao() {
		return observacao;
	}

	public void setObservacao(String observacao) {
		this.observacao = observacao;
	}

	public TipoAvalicao getAvaliacaoCasco() {
		return avaliacaoCasco;
	}

	public void setAvaliacaoCasco(TipoAvalicao avaliacaoCasco) {
		this.avaliacaoCasco = avaliacaoCasco;
	}

	public TipoAvalicao getAvaliacaoDenticao() {
		return avaliacaoDenticao;
	}

	public void setAvaliacaoDenticao(TipoAvalicao avaliacaoDenticao) {
		this.avaliacaoDenticao = avaliacaoDenticao;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public String getPesoToString() {
		return pesoToString;
	}

	public void setPesoToString(String pesoToString) {
		this.pesoToString = pesoToString;
	}

	public String getCincurferenciaToString() {
		return cincurferenciaToString;
	}

	public void setCincurferenciaToString(String cincurferenciaToString) {
		this.cincurferenciaToString = cincurferenciaToString;
	}

	public Double getCincurferencia() {
		return cincurferencia;
	}

	public void setCincurferencia(Double cincurferencia) {
		this.cincurferencia = cincurferencia;
	}

	public Usuario getUsuario() {
		return usuario;
	}

	public void setUsuario(Usuario usuario) {
		this.usuario = usuario;
	}

	public Date getDtCadastro() {
		return dtCadastro;
	}

	public void setDtCadastro(Date dtCadastro) {
		this.dtCadastro = dtCadastro;
	}

	public Date getDtAvaliacao() {
		return dtAvaliacao;
	}

	public void setDtAvaliacao(Date dtAvaliacao) {
		this.dtAvaliacao = dtAvaliacao;
	}

}
